<?php echo $this->doctype() ?>
<?php 
	$storage = new Zend_Auth_Storage_Session();
	$data = $storage->read();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>



<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>


	
	<?php echo $this->headTitle() ?>
	<?php echo $this->headMeta() ?>
    <?php echo $this->headLink() ?>    
    <?php echo $this->headStyle() ?>
    <?php echo $this->headScript() ?>	
    <?php $url = $this->baseUrl();?>
    
<script src="<?php echo $url;?>/application/templates/blog/bl_image/js/jquery.knob.js"></script>

<!-- jQuery File Upload Dependencies -->
<script src="<?php echo $url;?>/application/templates/blog/bl_image/js/jquery.ui.widget.js"></script>
<script src="<?php echo $url;?>/application/templates/blog/bl_image/js/jquery.iframe-transport.js"></script>
<script src="<?php echo $url;?>/application/templates/blog/bl_image/js/jquery.fileupload.js"></script>

    
<link rel="shortcut icon" type="image/x-icon" href="<?php echo $this->dirImg;?>/favicon.ico" />
    
</head>
<body>
<input type="hidden" id="url" value="<?php echo $url;?>" />
<div id="header">
	<div id="inside">
        <a href="/" target="_top" style="margin-top: -10px;">
        	<img style="height: 50px;" src="<?php echo $this->dirImg;?>/logo.png">
        </a>      
       
        
        <div class="registration">
        
        <div class="signup" id="signup" style="display:none;">
        
        	<form enctype="application/x-www-form-urlencoded" method="post" _lpchecked="1" action="<?php echo $url;?>/registration/auth/signup">
        
           	<strong class="title">Tài khoản Otaha mới? Đăng ký</strong> 
             
            <div class="placeholding-input">
	          	<input type="text" id="signup-user-name" class="text-input" autocomplete="off" name="fullname" maxlength="20" placeholder="Tên đầy đủ">
	          	
        	</div> 
        	<div class="placeholding-input">
          		<input type="text" id="signup-user-email" class="text-input email-input" autocomplete="off" name="email" placeholder="Email">
          		
        	</div>
        	<div class="placeholding-input">
          		<input type="password" id="signup-user-password" class="text-input" name="password" placeholder="Password">          		
        	</div>
        	<button type="submit" class="btn signup-btn">
          		Tạo tài khoản Otaha
        	</button>       	
        	
        	</form>
        	
		</div>
		
		
		
        <?php if(!isset($data->displayname)):?>
        <a href="Javascript:void(0);" id="jointext" onclick="onRegistration('signup','signin');">Đăng ký</a>
        <?php else :?>
        
        <div class="pull-right">
        	
        	<ul class="nav">
        		<li>
        			<span class="dropdown-toggle" onclick="onRegistration('dropdown-acc','');">        			
        				<span class="new-wrapper">

						<i class="nav-session">
						
						</i>
						<i class="nav-new"></i>						        				
        				</span>        			
        				<span class="caret"></span>
        			</span>
        			<ul class="dropdown-menu" id="dropdown-acc">
        				<li class="dropdown-caret">
	        				<span class="caret-outer"></span>
	        				<span class="caret-inner"></span>
        				</li>
        				<li class="current-user">
        				
        				<a href="<?php echo $url?>/profile" data-nav="all_lists">Thiết lập tài khoản</a>
        				
        				</li>
        				<li class="dropdown-divider"></li>
        				<li class="current-user">
        				
        				<a href="<?php echo $url?>/registration/auth/logout" data-nav="all_lists">Thoát</a>
        				
        				</li>
        				
        			</ul>
        		</li>
        	</ul>
        </div>
        
        
        <?php endif;?>
        <div class="signin" id="signin" style="display:none;">     
        	
        	
        	<dib class="form-sign">
        	
        	<form enctype="application/x-www-form-urlencoded" method="post" _lpchecked="1" action="<?php echo $url;?>/registration/auth/login">
        	
        		<div class="username">
        			<input type="text" name="email" id="signin-email" class="text-input email-input" name="session[username_or_email]" title="email" autocomplete="on" tabindex="1" placeholder="email">
        			<!-- <label for="signin-email" class="placeholder">Username or email</label> -->
        		</div>
        		
        		<table class="pass-sign">
	        		<tbody>
	        			<tr>
	        				<td class="flex-table-primary">
	        					<div class="placeholding-input password flex-table-form">
                				<input type="password" name="password" id="signin-password" class="text-input flex-table-input text-password" name="session[password]" title="Password" tabindex="2" placeholder="password">
                				<!-- <label for="signin-password" class="placeholder text-password">Password</label> -->
              					</div>
	        				</td>
	        				<td class="flex-table-secondary">
              					<button type="submit" class="submit btn primary-btn flex-table-btn js-submit" tabindex="4">
                				Vào ngay
              					</button>
            				</td>
	        			</tr>
	        		</tbody>
        		</table>
        		
        		</form>
        	
        	</dib>
        
        </div>
        
        
        
        <?php if(!isset($data->displayname)):?>
        <a id="jointext" href="javascript:void(0);" onclick="onRegistration('signin','signup');">Đăng nhập</a>
        <?php else :?>
        <a href="<?php echo $url;?>/post?id=<?php echo $data->id;?>" id="jointext"><?php echo $data->displayname;?></a>
        
        <a href="#" id="jointext">
        	<?php if($data->avatar != ""):?>
			
				<img alt="noavatar" style="width: 20px; height: 20px;" src="<?php echo $url;?>/upload/<?php echo $data->avatar;?>">
				
			<?php else :?>
				<img alt="noavatar" style="width: 20px; height: 20px;" src="http://0.gravatar.com/avatar/98d7a2361501957b551a32fceca493a5?s=56&d=mm&r=G">
			<?php endif;?>
        	
        	</a>
        
        <?php endif;?>
        
        </div>
    </div>
</div>

<div class="gl_container">

<div class="content">

<div>

<div class="mainContainer">


<div id="content-area" style="width: 100%;" class ="clearfix">

	<div id="content_right" style="width: 100%;">
	
	<?php echo $this->layout()->content ?>
	
		
	</div>

</div>

</div>
</div>
</div>
</div>

<div id="footer">

	<ul class="clearfix">
	<li><a href="<?php echo $url;?>">
		<img src="<?php echo $this->dirImg?>/home.gif" alt="HOME" width="40" height="11" class="imgover" hsrc="images/btn_footer01_o.gif"></a>
	</li>
	</ul>
	<address><img src="<?php echo $this->dirImg?>/txt_copyright.gif" alt="Copyright (C) Otaha. All rights reserved." width="306" height="10"></address>

</div>

<script type="text/javascript">

	$(document).mouseup(function (e)
	{
	    var container = $("#dropdown-acc");
	    var container1 = $("#signin");
	    var container2 = $("#signup");
	    
	
	    if (container.has(e.target).length === 0)
	    {
	        container.hide();
	        
	     
	    }
	    if (container1.has(e.target).length === 0){

	    	container1.hide();
		    
	    }

	    if (container2.has(e.target).length === 0){

	    	container2.hide();
		    
	    }
	    
	});

	

</script>



<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-40899090-1', 'otaha.com');
  ga('send', 'pageview');

</script>


</body>
</html>

